<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="../../common/Include_input_head.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="${basePath}/resources/js/common/json2.js"></script>
    <title></title>

    <script type="text/javascript">
        $(function () {
            var s = '${save}';
            if (s != null && s != '') {
                $("#menuFrame", parent.document).attr("src", $("#menuFrame", parent.document).attr("src"));
                alert("保存成功！");
            }

            $("#ysDelButton").click(function(){
                $.ajax({type: "DELETE", url: "${basePath}/s/uc/lk/d/" + $(":hidden[name='wid']").val(),
                    success : function(){
                        $("#menuFrame", parent.document).attr("src", $("#menuFrame", parent.document).attr("src"));
                        alert("删除成功！");
                    }});
            });
        });
    </script>
</head>

<body style="text-align:center;">
<div class="box1" panelWidth="99%">
    <form:form action="${basePath}/s/uc/lk/e" name="ysform" theme="simple" commandName="link" method="POST">
        <form:hidden path="wid"/>
        <form:hidden path="superid"/>
        <form:hidden path="supername"/>
        <form:hidden path="type"/>
        <form:hidden path="lev"/>
        <div class="box1" panelWidth="99%">
            <fieldset>
                <legend>友情链接信息</legend>
                <table class="tableStyle" transMode="true" footer="normal">
                    <c:if test="${link.wid != '0'.toString()}">
                        <tr>
                            <td align="right" width="16%" nowrap="nowrap">上级名称：</td>
                            <td align="left"> ${link.supername} </td>
                        </tr>
                    </c:if>
                    <tr>
                        <td align="right" width="16%" nowrap="nowrap">名称：</td>
                        <td align="left">
                            <form:input path="name" cssStyle="width: 300px;"/> <label style="color:red">*</label>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">链接地址：</td>
                        <td align="left"><form:input path="link" cssStyle="width: 300px;"/> <label style="color:red">*</label></td>
                    </tr>
                    <tr>
                        <td align="right">排序值：</td>
                        <td align="left"><form:input path="orderno" cssStyle="width: 300px;"/>
                            <label style="color:red">*</label><font color="#999999">说明：同一层次中数值小的往前排</font></td>
                    </tr>
                    <tr>
                        <td align="right">状态：</td>
                        <td align="left">
                            <form:radiobutton path="state" value="1" label="显示"/>
                            <form:radiobutton path="state" value="0" label="隐藏"/>
                            <label style="color:red">*</label></td>
                    </tr>
                </table>
            </fieldset>
        </div>
    </form:form>
    <div class="padding_top10">
        <table class="tableStyle" transMode="true">
            <tr>
                <td colspan="4">
                    <c:if test="${link.wid != '0'.toString() && link.wid != '1'.toString() && link.wid != '2'.toString()}">
                        <input type="button" id="ysSaveButton" value=" 保 存 " onclick="document.forms[0].submit()"/>&nbsp;
                        <input type="button" id="ysDelButton" value=" 删 除 "/>&nbsp;
                    </c:if>
                    <c:if test="${link.lev != 2 && link.lev != -1 && link.wid != null}">
                        <input type="button" id="ysInsertButton" value=" 新增子菜单 "
                           onclick="window.location.href='${basePath}/s/uc/lk/e?superid=${link.wid}'"/>
                    </c:if>
                </td>
            </tr>
        </table>
    </div>
</div>

</body>
</html>
